<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="StyleSheet" href="<%=request.getContextPath()%>/css/dtree.css" type="text/css" />
	<script type="text/javascript">		
  				function add(fromObj,toObj){
  					var lengthOfToObj=toObj.length;   
				  for(var i=fromObj.length-1;i>-1;i--)   
				  {
				  var z = 0;
				  if(fromObj.options[i].selected)   
				  	{
				  	  for(var j = 0; j < toObj.length; j ++){
				  	  	if(toObj.options[j].value == fromObj.options[i].value){
				  	  		z = -1;
				  	  		break;
				  	  	}
					  }
					  if(z == 0){
					  	  toObj.add(new Option(fromObj.options[i].text,fromObj.options[i].value),lengthOfToObj);   
						  toObj.options[lengthOfToObj].selected=true;   
					  }
					  //fromObj.options[i].removeNode(true);   
  					}   
  				  } 
  				}
  				
  				function move(fromObj){
				  for(var i=fromObj.length-1;i>-1;i--)  
				  {
				  if(fromObj.options[i].selected)   
				  	{  
					  fromObj.options[i].removeNode(true);
  					}   
  				  } 
  				}
  				
		</script>
<title>选择用户</title>
</head>

<body>
<form action="<%=request.getContextPath()%>/RoleInfo.do?method=addUser&rid=<%=request.getParameter("rid") %>" name="form1" method="post">
<table width="966" height="200" border="0" valign="center">
  <tr>
    <td width="60" rowspan="6">
      <iframe name="itree" src="<%=request.getContextPath()%>/PersionFile.do?method=organUsertree" frameBorder="0" width="200" height="300">
      </iframe>
    </td>
    <td width="796" height="50" align="left"><tr align="left"><th>监察人员</th></tr>
    <tr align="left"><td align="left">
    <iframe name="rightMenu" src="<%=request.getContextPath()%>/PersionFile.do?method=selectUserList" frameBorder="0" width="350" height="200">
    </iframe>
    </td></tr>
  <tr>
    <td height="46" align="left">
    <input align="left" type="button" value="增加" class="button1" onclick="add(rightMenu.document.all('UserSelect'), document.all.perFileId)"/>
	<input align="left" type="button" value="移除" class="button1"  onclick="move(document.all.perFileId)"/></td>
  </tr>
  <tr align="center">
    <td height="55" align="center"><table border="0" width="100%" align="left">
				<tr>
					<td align="left">
							<strong>所选用户</strong>
					</td>
				</tr>
				<tr>
					<td align="left">
						<select name="perFileId" size="6" id="perFileId" style="width:300" multiple="multiple">
						</select>
					</td>
				</tr>
			</table></td>
  </tr>
  <tr>
    <td align="left" height="41"><input type="submit" name="" value="确认" /></td>
  </tr>
</table>
</form>
</body>
</html>
